window.onload = function() {
    //herder数据
    var headData = {
        list: [{
            name: 'keke',
            age: 26,
            address: '北京市'
        },{
            name: 'keke',
            age: 25,
            address: '北京市'
        },{
            name: 'keke',
            age: 18,
            address: '北京市'
        }]
    }
    //footer数据
    var footData = {
    	text: '我是底部数据',
        list: [{
                "title": "美女",
                "author": "有很多"
            },
            {
                "title": "跑车",
                "author": "中国制造"
            },
            {
                "title": "哈雷",
                "author": "摩托车"
            },
            {
                "title": "帅哥",
                "author": "也不少"
            }
        ]
    }


    // 引入模板并且传入数据
    document.getElementById('header').innerHTML = template('header', headData);
    document.getElementById('footer').innerHTML = template('footer', footData);
    //template里面的header 就是模板的名字

}